package com.zq.thread;

/**
 * @Author: zhaoqi
 * @Date: 11/23/2019 10:50 PM
 * @Version 1.0
 */

public class Demozq1 {

    public static void main(String[] args) throws InterruptedException {
        Demozq1.demo();
    }

    private static  void demo() throws InterruptedException {
        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("running");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("running");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });


        thread1.start();
        thread2.start();

        thread1.join();
        thread2.join();
        System.out.println("main over");

    }

}
